/*
 * @Description:
 * @Author: wangyan
 * @Date: 2021-03-02 11:00:34
 * @LastEditTime: 2021-03-23 15:34:21
 * @LastEditors: @yzcheng
 */

import { CHECC_API_PROCESS } from '@/constants/proxy';
import { getThreeMonths } from "@/utils/currency";
import request from '@/utils/request';

//根据id 删除 
export function pageTodoList(pageOption, params = { endTime: new Date().getTime(), startTime: getThreeMonths(), }) {
    return request({
        url: CHECC_API_PROCESS + `/act/task/todo?page=${pageOption.pageNum}&size=${pageOption.pageSize}`,
        method: 'get',
        params
    })
}
//开始实例任务 （测试用的 test）
export function startTask(data) {
    return request({
        url: CHECC_API_PROCESS + "/user/process/instance/start",
        method: "post",
        data
    })
}
//委派一个任务
export function delegateTask(data) {
    return request({
        url: CHECC_API_PROCESS + "/act/task/delegateTask",
        method: "post",
        data
    })
}
//转办一个任务
export function trunTask(data) {
    return request({
        url: CHECC_API_PROCESS + "/act/task/trunTask",
        method: "post",
        data
    })
}

export function backTask(data) {
    return request({
        url: CHECC_API_PROCESS + "/act/task/over",
        method: "post",
        data
    })
}

export function backFirstTask(data) {
    return request({
        url: CHECC_API_PROCESS + "/act/task/over_first",
        method: "post",
        data
    })
}
export function overTask(data) {
    return request({
        url: CHECC_API_PROCESS + "/act/task/over",
        method: "post",
        data
    })
}

export function saveCopiesData(data) {
    return request({
        url: CHECC_API_PROCESS + "/copy-task/add",
        method: "post",
        data
    })
}

